package ar.com.notarip.bb.infosubte;

import java.util.Vector;

import ar.com.notarip.bb.infosubte.util.Util;

public class OpcionesService {
	
	private static String LINEAS = "lineas";
	private static String PUSH = "push";
	
	public static String getPushTime(){
		
		
		Vector vec = PersistentService.getOpciones(PUSH);
		String pushTime = "0";
		if (vec != null){
			pushTime = (String)(vec.elementAt(0));
		}
		
		
		return pushTime;
		
	}
	
	public static int getPushTimeAsInt() {
		
		String pushTime = getPushTime();
		return Integer.valueOf(pushTime).intValue();
		
	}
	
	
	public static void setPushTime(String choices){
		
		Vector vecPush = new Vector();
		vecPush.addElement(choices);
		PersistentService.save(PUSH, vecPush);

		
	}


	public static void setLinesEnables(Vector vecLineas) {

		PersistentService.save(LINEAS, vecLineas);
	}


	public static Vector getLinesEnables() {
		
		return PersistentService.getOpciones(LINEAS);
		
	}
	
	public static boolean validateOptions(String line) {
		
		
		Vector vec = PersistentService.getOpciones();
		
		if (vec != null){
		
			int id = Util.getCodigoLinea(line);
			
			Boolean bool = (Boolean)vec.elementAt(id);
			
			return bool.booleanValue();
			
		}
		
		return true;

	}
	
	

}
